import 'dart:convert';

import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/risk_tree_entity.g.dart';
export 'package:enterprise_v6_app/generated/json/risk_tree_entity.g.dart';

///风险对象
@JsonSerializable()
class RiskTreeEntity {
  RiskTreeEntity();

  factory RiskTreeEntity.fromJson(Map<String, dynamic> json) => $RiskTreeEntityFromJson(json);

  ///	子集
  List<RiskTreeEntity>? children = [];

  ///	当前风险等级：1_重大2_较大3_一般4_低
  String? currentRiskLevel = '';

  ///	管控手段
  String? dataSrc = '';

  ///	责任部门
  String? hazardDep = '';

  ///	责任部门
  String? hazardDepId = '';

  ///	辨识人id
  String? hazardDistinguishPersonId = '';

  ///	责任人
  String? hazardLiablePerson = '';

  ///	责任人id
  String? hazardLiablePersonId = '';

  ///
  String? id = '';

  ///	初始风险等级：1_重大2_较大3_一般4_低
  String? initialRiskLevel = '';

  ///	对象当前层级
  int? level = 1;

  ///	名称
  String? name = '';

  ///	父级id
  String? parentId = '';

  ///	任务数量
  int? taskCount = 0;

  /// 是否展开
  bool? isExpand = false;
  /// 路径
  String? path;


  Map<String, dynamic> toJson() => $RiskTreeEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
